{% extends 'user/user.html' %} {% block title %}收货地址{% endblock title %}
 {% load static %}
{%block title1 %}收货地址 {% endblock title1 %}
{%block haed_files %}
<script src="{% static 'js/form_forms.validate.min.js' %}"></script>
<script src="{% static 'js/addr_experience.js' %}"></script>
        <link rel="stylesheet" href="{% static 'css/form_modernforms.min.css' %}" />
        <link rel="stylesheet" href="{% static 'css/form_theme-blue.css' %}" />
{% endblock haed_files %}
{% block contents %}
<div class="site_contents">
                    <div>收货地址</div>
                    <div>
                        <div>当前地址：</div>
                        {% if add_user %}
                        <p>
                            {{add_user.addr}} （{{add_user.receiver}} 收）{{add_user.phone}}
                        </p>
                        {% else %}
                        <p>没有默认收货地址</p>
                        {% endif %}
                    </div>
                    <div class="edit_site">编辑地址</div>
                    <div class="cdn-bg">
                        <form
                            class="modern-forms"
                            id="form"
                            style="width: 600px; margin: 30px auto"
                            method="POST"
                        >
                        {% csrf_token %}
                            <fieldset>
                                <div class="form-row">
                                    <div class="col col-6">
                                        <div class="field-group">
                                            <input
                                                type="text"
                                                name="name"
                                                data-required="内容不能为空"
                                                class="mdn-input"
                                                placeholder="收件人"
                                            />
                                            <label class="mdn-label"
                                                >收件人</label
                                            >
                                            <span class="mdn-bar"></span>
                                        </div>
                                    </div>
                                </div>
                                <!-- end form-row -->
                                <div class="form-row">
                                    <div class="col col-6">
                                        <div class="field-group">
                                            <textarea
                                                name="addr"
                                                id=""
                                                cols="30"
                                                rows="30"
                                                data-required="内容不能为空"
                                                class="mdn-input"
                                            ></textarea>
                                            <label class="mdn-label"
                                                >详细地址</label
                                            >
                                            <span class="mdn-bar"></span>
                                        </div>
                                    </div>
                                </div>
                                <!-- end form-row -->

                                <div class="form-row">
                                    <div class="col col-6">
                                        <div class="field-group">
                                            <input
                                                type="text"
                                                name="zip_code"
                                                class="mdn-input"
                                                placeholder="邮编"
                                            />
                                            <label class="mdn-label"
                                                >邮编</label
                                            >
                                            <span class="mdn-bar"></span>
                                        </div>
                                    </div>
                                </div>
                                <!-- end form-row -->
                                <div class="form-row">
                                    <div class="field-group prepend-icon">
                                        <input
                                            type="text"
                                            name="phone"
                                            data-phone="请输入正确的手机号码"
                                            class="mdn-input"
                                            placeholder="手机号码"
                                        />
                                        <label class="mdn-label"
                                            >手机号码</label
                                        >
                                        <span class="mdn-icon"
                                            ><i class="fa fa-globe"></i
                                        ></span>
                                        <span class="mdn-bar"></span>
                                    </div>
                                </div>
                                <!-- end form-row -->
                            </fieldset>

                            <div class="mdn-footer">
                                <button
                                    type="button"
                                    id="submitBtn"
                                    class="mdn-button btn-flat"
                                >
                                    确认
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
{% endblock contents %}
{% block bottom_file %}
<script>
            $(function () {
                $("#form").form({
                    submitBtn: "#submitBtn",
                    sends: false,
                    success: function (data) {
                        console.log(data);
                    },
                    fail: function (data) {
                        console.log(data);
                    },
                });
            });
        </script>
{% endblock bottom_file %}